Hands-On Bug Hunting for Penetration Testers by Joseph Marshall

Hands-On Bug Hunting for Penetration Testers by Joseph Marshall

Author:Joseph Marshall
Language: eng
Format: mobi, epub
Publisher: Packt
Published: 2018-09-10T08:09:25+00:00


from bs4 import BeautifulSoup, Tag

def generate_poc(method, encoding_type, action, fields):

""" Generate a CSRF PoC using basic form data """

content = BeautifulSoup("<html></html>", "html.parser")

html_tag = content.find("html")

form_tag = content.new_tag("form", action=action, method=method, enctype=encoding_type)

html_tag.append(form_tag)

for field in fields:

label_tag = content.new_tag('label')

label_tag.string = field['label']

field_tag = content.new_tag("input", type=field['type'], value=field['value'])

field_tag['name'] = field['name']

form_tag.append(label_tag)

form_tag.append(field_tag)



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.